package test;

import dao.StaffsDao;
import dao.impl.StaffsDaoImpl4jdbc;
import entity.Staffs;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 添加
 * @Author lzp
 * @Date 2024-03-06
 */
public class test02 {
    public static void main(String[] args) {
        StaffsDao staffsDao = new StaffsDaoImpl4jdbc();

        String sqlAddTime = "2022-05-15 13:30:00";
        DateTimeFormatter sqlAddformatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime updateTime1 = LocalDateTime.parse(sqlAddTime, sqlAddformatter);


        String fixedTime = "2022-05-15 13:30:00";
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime updateTime = LocalDateTime.parse(fixedTime, formatter);



        Staffs s = new Staffs();
        s.setName("0廖0神0");
        s.setAge(28);
        s.setPhone("22222222222");
        s.setPos("董事长");
        s.setAddTime(updateTime1);
        s.setUpdateTime(updateTime);

        int row = staffsDao.insert(s);
        System.out.println(row);

    }
}
